
function chat(text) {
    doubiModel.append(
                {
                    "answer":text,
                    "isrobot":0
                });
    var xhr = new XMLHttpRequest();
    var url="http://api.xiaodoubi.com/api.php?key=73C89DC7-25EC-A32C-B6E9-2AB8BCF75249&chat="+text;
    xhr.open("GET",url,true);
    xhr.onreadystatechange = function()
    {
        if ( xhr.readyState == xhr.DONE)
        {
            if ( xhr.status == 200)
            {
                var answer = xhr.responseText;

                doubiModel.append(
                            {
                                "answer":answer,
                                "isrobot":1
                            });
             listView.positionViewAtEnd();
            }
        }
    }
    xhr.send();
}

